package cn.kgc.shiro;

import org.apache.shiro.crypto.hash.Md5Hash;

import javax.lang.model.element.VariableElement;

/**
 * @author: mosin
 * @version: v1.0  2022/11/16
 * 加密工具类
 */
public class TestMD5 {

    public static void main(String[] args) {

        String pwd = "12345";
        //加密
        Md5Hash md5Hash = new Md5Hash(pwd);
        String s = md5Hash.toHex();
        System.out.println("s = " + s);

        //加密 + salt
        Md5Hash md5Hash1 = new Md5Hash(pwd, "hello");
        String s1 = md5Hash1.toHex();
        System.out.println("s1 = " + s1);


        //加密 + salt+hashNumber
        Md5Hash md5Hash2 = new Md5Hash(pwd, "hello", 1024);
        String s2 = md5Hash2.toHex();
        System.out.println("s2 = " + s2);

    }
}
